home *** CD-ROM | disk | FTP | other *** search
-
- tBU v1.1 - Batch Utility - Planet Terus
-
- Usage: tbu <option symbol arg1 arg2 ...> <option ... >
-
- Sets the DOS environment symbol based on the option chosen. tBU will
- process multiple sets of option-symbol-arg sets from left to right.
-
- Symbols may be used in batch commands as %SYMBOL% (symbol must appear
- in all capital letters). The symbol set by tBU CAN be empty. To check
- for an empty symbol use something like:
- IF (%SYMBOL%) == () echo It's empty
- IF not (%SYMBOL%) == () echo It's not empty
-
- ERRORLEVEL is returned as 255 if error occured. The option character
- may be either a dash (-) or a slash (/).
-
- Options:
- -f Parse filename & extension. <sym> <filespec>
- Sets symbol to the filename portion of arg1. Any dot name/
- extension separator is not changed.
- ERRORLEVEL: Length of resulting string.
- Example: tbu -f file c:\tbu.exe sets file to tbu.exe
- tbu -f file c:\data. sets file to data.
- tbu -f file c:\data sets file to data
-
- -x Parse file extension only. <sym> <filespec>
- Sets symbol to the extension portion of arg1. The dot name/
- extension separator is always removed.
- ERRORLEVEL: Length of resulting string.
- Example: tbu -e ext c:\cmd\tbu.exe sets ext to exe
-
- -n Parse name only. <sym> <filespec>
- Sets symbol to the name portion of arg1. The dot name/
- extension separator is always removed.
- ERRORLEVEL: Length of resulting string.
- Example: tbu -n name c:\tbu.exe sets name to tbu
-
- -l Parse disk drive letter only. <sym> <filespec>
- Sets symbol to the drive letter portion of arg1. The colon
- drive/name separator is always removed.
- ERRORLEVEL: Length of resulting string.
- Example: tbu -d drive c:\tbu.exe sets drive to c
-
- -c Input character from keyboard. <sym> [prompt] [valid] [secs]
- Sets symbol to the upper case value of the character entered.
- Optional prompt (may be ""). Optional valid characters, are
- not case sensitive. Optional seconds for timed input. Accepts
- printable keys only, carriage return = !. Keys |, <, and > are
- not allowed because of conflicts with DOS i/o redirection.
- ERRORLEVEL: ASCII code of character entered, 0 = timeout.
- Example: tbu -c ans "Ok (Y/N)?" sets ans to any & prompts.
- Example: tbu -c ans "" yn sets ans to Y or N.
- Example: tbu -c ans "" "" 20 sets ans to any & times 20 secs.
-
- -s Input string from keyboard. <sym> [prompt] [max length]
- Sets symbol to the string entered. Optional prompt (may
- be ""). Optional max input length (128 chars default).
- ERRORLEVEL: Length of string entered.
- Example: tbu -s user "Your name: " sets user to string.
-
- -r Get DOS revision. <sym> [major|minor|both]
- Sets symbol to the desired portion of the DOS version.
- Default = Both.
- ERRORLEVEL: None.
- Example: tbu -r rev major
-
- -d Get system date. <sym> <format>
- Sets symbol to the system date in the specified format.
- The format is embedded in a string: $[modifier]<element type>
- Element types: Allowable modifiers:
- y = year [a for 2 digit year]
- m = month [0_wWaA]
- d = day of month [0_]
- j = Julian date [0_]
- k = day of week [0_wWaA] (numeric Sun=0, Mon=1,...)
- Modifiers for numeric values:
- 0 = zero pad on left
- _ = space pad on left
- Modifiers for string values:
- w = full word instead of number (W = all upper case)
- a = abbreviated word instead of number (A = all upper case)
- ERRORLEVEL: None.
- Example: tbu -d date "The date is: $wk, $wm, $0d $y"
-
- -t Get system time. <sym> <format>
- Sets symbol to the system time in the specified format.
- The format is embedded in a string: $[modifier]<element type>
- Element types: Allowable modifiers:
- h = hours [0_]
- m = minutes
- s = seconds
- a = AM/PM (h = 1-12 if present)
- d = daylight (Y = daylight savings time in effect)
- Modifiers for numeric values:
- 0 = zero pad on left
- _ = space pad on left
- ERRORLEVEL: None.
- Example: tbu -t time "The time is: $0h:$m:$s $a"
-
- -b Substitute pattern for data. <sym> <patt> <data> <string>
- Replaces pattern with data in string. Sets symbol to
- the new string.
- ERRORLEVEL: Length of new string.
- Example: tbu -b new "change this" "to this" "Point: change this"
-
- Another Smileware program from Planet Terus <PT>. If you like it, send
- us a smile "*<B-)" at IFNA(tm) 104/43 -- (303) 469-7161.
-